package cn.endeavour.user.controller;

import cn.endeavour.basic.exception.BusinessException;
import cn.endeavour.basic.util.AjaxResult;
import cn.endeavour.basic.util.PageList;
import cn.endeavour.user.domain.User;
import cn.endeavour.user.domain.WxUser;
import cn.endeavour.user.dto.UserDto;
import cn.endeavour.user.query.UserQuery;
import cn.endeavour.user.query.WxUserQuery;
import cn.endeavour.user.service.IUserService;
import cn.endeavour.user.service.IWxUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 这是用户的接口
 * 主要做增删改查
 * Api对接口的描述
 */
@RestController
@RequestMapping("/wxUser")
@Api(tags = "用户接口",description = "用户接口详细描述")
public class WxUserController {

    @Autowired
    private IWxUserService wxUserService;


    /**
     * 查询有多个参数,然后用post 请求,然后用RequestBody在请求体将数据取出
     * @param userQuery 前端传入的查询参数
     * @return 总条数以及分页数据
     */
    @PostMapping
    @ApiOperation(value = "分页查询",notes = "传入分页参数")
    public PageList<WxUser> query(@RequestBody WxUserQuery userQuery) {
        return wxUserService.queryPage(userQuery);
    }

}
